<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection" />
		<meta content="emai=no" name="format-detection" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>gene/css/common.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>gene/css/order.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>shared/css/shared.css" />
		<script type="text/javascript" src="<?php echo STATIC_HOST;?>shared/js/zepto-1.1.6.js"></script>
		<script>
			Zepto(function ($) {
				function onBridgeReady() {
					WeixinJSBridge.call('hideOptionMenu');
				}

				if (typeof WeixinJSBridge == "undefined") {
					if (document.addEventListener) {
						document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
					} else if (document.attachEvent) {
						document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
						document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
					}
				} else {
					onBridgeReady();
				}
			});
		</script>
		<title>提交订单</title>
	</head>
	<body>
		<div class="wrapper">
			<h2 class="h-red">确 认 订 单</h2>
			<ul class="info">
				<li <?php if(!$mobile):?> data-href="/user/set-mobile" <?php endif;?> class="flex-wrapper flex-align-center">
					<p>
						购买人
					</p>
					<p class="flex-1">
						<?php if($mobile):?>
						<?php echo $mobile;?>
						<?php else:?>
							设置手机号<br/>享受芝士妈妈会员特权
						<?php endif;?>
					</p>
				</li>
				<li data-href="/address" class="flex-wrapper flex-align-center">
					<p>
						收货<br/>地址
					</p>
					<p class="flex-1">
						<?php if($default_address):?>
						<?php echo $default_address['province'] . $default_address['city'] . $default_address['district'] . $default_address['address']?><br ／> <?php echo $default_address['addressee']?> <?php echo $default_address['telephone'];?>
						<?php endif;?>
					</p>
				</li>
			</ul>	
			<h2 class="h-blue">商 品 列 表</h2>
			<form action="/sale/order/quick-order" method="post">
				<input type="hidden" name="address_id" id="address_id" <?php if(!$default_address):?> data-message="请设置收货地址" <?php else:?>value="<?php echo $default_address['id']?>"<?php endif;?> />
				<input type="hidden" name="mobile" id="mobile" data-message="请设置手机号" value="<?php echo $mobile;?>">
				<input type="hidden" name="product_id" id="product_id" value="<?php echo $product['product_id']?>"/>
				<input type="hidden" name="num" id="num" value="<?php echo $num?>"> 
				<div class="product flex-wrapper flex-align-center">
					<p>
						<span class="avatar">
							<?php echo $product_html['product_img'] ?>
						</span>
					</p>
					<div class="flex-1">
						<p class="title"><?php echo $product['product_name']?></p>
						<p class="notice">（免运费商品）</p>
						<p class="price clear"><span class="s-left">X <?php echo $num;?></span>&yen; <?php echo number_format($product_price * $num, 2)?></p>
					</div>
				</div>
				<button class="btn btn-red" type="submit">付 款 预 约</button>
			</form>
		</div>
		<script type="text/javascript" src="<?php echo STATIC_HOST;?>shared/js/shared.js"></script>
		<script type="text/javascript" src="<?php echo STATIC_HOST;?>shared/js/form.js"></script>
		<script type="text/javascript" src="<?php echo STATIC_HOST;?>gene/js/order.js"></script>
	</body>

</html>